const path = require('path');
module.exports = {
    mode:'development',
    devtool:'source-map',
    entry:{
        main:'./src/index.js'
    },
    output:{
        path:path.resolve(__dirname,'dist'),
        filename:'bundle.js',
    },
    resolveLoader:{
        /* alias: {
            'loader1':path.resove(__dirname,'loaders','loader1')
        }, */
        modules:[path.resolve(__dirname,'node_modules'),path.resolve(__dirname,'loaders')]
    },
    module:{
        rules:[
            {//css-loader是用来处理解析@import "base.css" url(./bg.jpg)
                test:/\.css$/,
                use:['style-loader','css-loader']
            },
             {
                test:/\.(jpg|png|gif)$/,
                use:[
                    {
                        loader:'url-loader',
                        options:{
                            limit:0
                        }
                    }
                ]
            }
        ]
    }
}